#include "Echart.h"

int main(void)
{
	Echart *ec;
	Echart_Dataset *eds;
	char *guri;

	echart_init();
	ec = echart_bar_new();
	echart_title_set(ec, "Bars01");
	echart_bar_type_set(ec, ECHART_BAR_VERTICAL_STACKED);

	eds = echart_bar_dataset_new();
	echart_dataset_label_set(eds, "first");
	echart_dataset_color_set(eds, 0xff344556);
	echart_dataset_values_add(eds, 4, 10.5, 21.3, 34.8, 8.1);
	echart_dataset_add(ec, eds);

	eds = echart_bar_dataset_new();
	echart_dataset_label_set(eds, "second");
	echart_dataset_values_add(eds, 4, 12.5, 23.3, 36.8, 10.1);
	echart_dataset_add(ec, eds);

	echart_generate(ec, echart_gchart_get(), &guri);
	printf("uri = %s\n", guri);
	echart_free(ec);
	echart_shutdown();

	return 0; 
}
